let name = 'zhangsan'
let address = 'dalian'
// let age = 10
// // let info = name + '住在' + address 
// let info2 = `${name}他${age}岁了，他住在${address}`
// console.log(info2);
// console.log(sname[0]); 
// console.log(sname.charAt(3));
// console.log(sname.length);
// for(let i =0;i < sname.length;i++){
//     console.log(sname[i]);
// }


let sentence = 'this is a book'
let arr = sentence.split(' ')
console.log(arr);

let email = 'zhangsan@neusoft.com'
let arr2 = email.split('@')
console.log(arr2[0]);
console.log(arr2[1]);

let nums = '1,2,3,4,5'
let  arr3 = nums.split(',')
let result = 0;
for(let i = 0; i < arr3.length; i++){
    result += parseInt (arr3[i])
}
console.log(result);